#include "email.h"
#include <sstream>
#include <iostream>
/*
 *	Name: Joshua Zuber
 *	Date: 3/19/2014
 *  Course: CS 325; Spring 2014
 *	Description:	This file contains the implementation of the constructors and core functions of the email class.
 */
using namespace E;
using namespace std;

Email::Email(){
	body = "";
	numberOfWords = 0;
	numOutliers = 0;
};

Email::Email(string body, int numberOfWords){
	this->body = body;
	this->numberOfWords = numberOfWords;
	numOutliers = 0;
};

void Email::insertIntoArray(string x){
	if(numOutliers < 15){
		outliers[numOutliers] = x;
		numOutliers++;
	} else{
		cerr << "There are too many outliers.  The maximum is 15.";
	}
};

string Email::printElementsInArray(){
	ostringstream list;
	for(int i=0;i<numOutliers;i++){
		list << outliers[i];
		if(i != numOutliers-1){
			list << ", ";
		}
	}
	return list.str();
};

